/*------------------------------------------------
<> SCREEN_OBJECT class
<> 2008.07.31 - Robert Vanca
<> v0.1

Screen object. Represents a 2D object on screen.
Features:
	- HitBox checking.
	- Connection handling with other objects.
	- Selection, Unselection.

TODO:	- Make this class do more, even 3D
		- Make it more robust.
--------------------------------------------------*/
#pragma once
#ifndef _BASELIB_SCREENOBJECT_H
#define _BASELIB_SCREENOBJECT_H

using namespace std;

class ScreenObject
{
private:
	int x;
	int y;
	int width;
	int height;
	COLOR color;
	bool selected;
	cBITMAP*	bitmap;
	vector<ScreenObject*> Connections;
		
public:
	ScreenObject (void):x(0),y(0),width(100),height(100),selected(false), bitmap(0) { SetColor(COLOR(255,255,255));}
	ScreenObject (int posx, int posy) : x(posx), y(posy), width(100),height(100),selected(false), bitmap(0) { SetColor(COLOR(255,255,255));}
	ScreenObject (const wchar_t*);
	~ScreenObject (void);

	inline void Select(){ selected = true; }
	inline void UnSelect(){ selected = false; }
	inline void SetColor (COLOR setcolor){ color = setcolor; }
	inline void SetPos (int newx, int newy) { x = newx; y = newy; }
	inline void AddConnection(ScreenObject* SOPointer) { Connections.push_back(SOPointer); }

	inline int GetPosX() const { return x; }
	inline int GetPosY() const { return y; }
	inline bool IsSelected() const { return selected; }

	int HitBox (int, int);

	void Render (BASE_RENDERER* pRenderer);
	void RenderConnections(BASE_RENDERER* pRenderer, COLOR col);
	
	
};

#endif //#define _BASELIB_SCREENOBJECT_H